3.31 \(\int \frac{\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx\)

Optimal. Leaf size=55 \[ \frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{b}}\right )}{\sqrt{a} f (a+b)}-\frac{\tanh ^{-1}(\cos (e+f x))}{f (a+b)} \]

[Out]

(Sqrt[b]*ArcTan[(Sqrt[a]*Cos[e + f*x])/Sqrt[b]])/(Sqrt[a]*(a + b)*f) - ArcTanh[Cos[e + f*x]]/((a + b)*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0705629, antiderivative size = 55, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {4133, 481, 206, 205} \[ \frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{b}}\right )}{\sqrt{a} f (a+b)}-\frac{\tanh ^{-1}(\cos (e+f x))}{f (a+b)} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

(Sqrt[b]*ArcTan[(Sqrt[a]*Cos[e + f*x])/Sqrt[b]])/(Sqrt[a]*(a + b)*f) - ArcTanh[Cos[e + f*x]]/((a + b)*f)

Rule 4133

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = F
reeFactors[Cos[e + f*x], x]}, -Dist[ff/f, Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*(ff*x)^n)^p)/(ff*x)^(n*
p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p
]

Rule 481

Int[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> -Dist[(a*e^n)/(b*c -
a*d), Int[(e*x)^(m - n)/(a + b*x^n), x], x] + Dist[(c*e^n)/(b*c - a*d), Int[(e*x)^(m - n)/(c + d*x^n), x], x]
/; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LeQ[n, m, 2*n - 1]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{x^2}{\left (1-x^2\right ) \left (b+a x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (e+f x)\right )}{(a+b) f}+\frac{b \operatorname{Subst}\left (\int \frac{1}{b+a x^2} \, dx,x,\cos (e+f x)\right )}{(a+b) f}\\ &=\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{b}}\right )}{\sqrt{a} (a+b) f}-\frac{\tanh ^{-1}(\cos (e+f x))}{(a+b) f}\\ \end{align*}

Mathematica [C]  time = 0.623957, size = 239, normalized size = 4.35 \[ \frac{\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sin (e) \tan \left (\frac{f x}{2}\right ) \left (-\sqrt{a}-i \sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2}\right )+\cos (e) \left (\sqrt{a}-\sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2} \tan \left (\frac{f x}{2}\right )\right )}{\sqrt{b}}\right )}{\sqrt{a}}+\frac{\sqrt{b} \tan ^{-1}\left (\frac{\sin (e) \tan \left (\frac{f x}{2}\right ) \left (-\sqrt{a}+i \sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2}\right )+\cos (e) \left (\sqrt{a}+\sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2} \tan \left (\frac{f x}{2}\right )\right )}{\sqrt{b}}\right )}{\sqrt{a}}+\log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )}{f (a+b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

((Sqrt[b]*ArcTan[((-Sqrt[a] - I*Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a]
 - Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2]*Tan[(f*x)/2]))/Sqrt[b]])/Sqrt[a] + (Sqrt[b]*ArcTan[((-Sqrt[a] + I*S
qrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a] + Sqrt[a + b]*Sqrt[(Cos[e] - I*S
in[e])^2]*Tan[(f*x)/2]))/Sqrt[b]])/Sqrt[a] - Log[Cos[(e + f*x)/2]] + Log[Sin[(e + f*x)/2]])/((a + b)*f)

________________________________________________________________________________________

Maple [A]  time = 0.066, size = 76, normalized size = 1.4 \begin{align*} -{\frac{\ln \left ( 1+\cos \left ( fx+e \right ) \right ) }{f \left ( 2\,a+2\,b \right ) }}+{\frac{b}{f \left ( a+b \right ) }\arctan \left ({a\cos \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{\ln \left ( -1+\cos \left ( fx+e \right ) \right ) }{f \left ( 2\,a+2\,b \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)/(a+b*sec(f*x+e)^2),x)

[Out]

-1/f/(2*a+2*b)*ln(1+cos(f*x+e))+1/f*b/(a+b)/(a*b)^(1/2)*arctan(a*cos(f*x+e)/(a*b)^(1/2))+1/f/(2*a+2*b)*ln(-1+c
os(f*x+e))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 0.564539, size = 410, normalized size = 7.45 \begin{align*} \left [\frac{\sqrt{-\frac{b}{a}} \log \left (-\frac{a \cos \left (f x + e\right )^{2} + 2 \, a \sqrt{-\frac{b}{a}} \cos \left (f x + e\right ) - b}{a \cos \left (f x + e\right )^{2} + b}\right ) - \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) + \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{2 \,{\left (a + b\right )} f}, \frac{2 \, \sqrt{\frac{b}{a}} \arctan \left (\frac{a \sqrt{\frac{b}{a}} \cos \left (f x + e\right )}{b}\right ) - \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) + \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{2 \,{\left (a + b\right )} f}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(-b/a)*log(-(a*cos(f*x + e)^2 + 2*a*sqrt(-b/a)*cos(f*x + e) - b)/(a*cos(f*x + e)^2 + b)) - log(1/2*c
os(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/((a + b)*f), 1/2*(2*sqrt(b/a)*arctan(a*sqrt(b/a)*cos(f*x +
e)/b) - log(1/2*cos(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/((a + b)*f)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)**2),x)

[Out]

Integral(csc(e + f*x)/(a + b*sec(e + f*x)**2), x)

________________________________________________________________________________________

Giac [A]  time = 1.14841, size = 116, normalized size = 2.11 \begin{align*} -\frac{\frac{2 \, b \arctan \left (-\frac{a \cos \left (f x + e\right ) - b}{\sqrt{a b} \cos \left (f x + e\right ) + \sqrt{a b}}\right )}{\sqrt{a b}{\left (a + b\right )}} - \frac{\log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a + b}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

-1/2*(2*b*arctan(-(a*cos(f*x + e) - b)/(sqrt(a*b)*cos(f*x + e) + sqrt(a*b)))/(sqrt(a*b)*(a + b)) - log(-(cos(f
*x + e) - 1)/(cos(f*x + e) + 1))/(a + b))/f